************************
* 2019 HKDC (Figure 1) *
************************
use "gtrend_2019hkdc+weather.dta", replace 
set scheme white_ptol
gen x = date(date, "DMY")
gen day = x - td(24Nov2019)
tsset day

twoway tsline hkdc weather, yline(0, lw(vvthin)) lcolor("35 91 200" black%40) lpattern("l" "shortdash") ylabel(0(20)100, nogrid labsize(2)) ///
	tlabel(-25(5)25) tline(0, lcolor(black) lpattern("l")) ///
	ytitle("Count (Normalized to a 0-100 range)") xtitle("Day(s) from the election")   ///
	title("Macau Google Trend Data", size(4.0) position(11)) ///
	legend(on pos(6) row(1) label(1 "2019 Hong Kong local election") lab(2 "Weather"))
graph export gtrend_2019hkdc+weather.png, replace		


***************************
* 2015 HKDC  (Figure B.1) *
***************************
use "gtrend_2015hkdc+weather.dta", replace 
set scheme white_ptol
gen x = date(date, "DMY")
gen day = x - td(22Nov2015)
tsset day

twoway tsline hkdc weather, yline(0, lw(vvthin)) lcolor("35 91 200" black%40) lpattern("l" "shortdash") ylabel(0(20)100, nogrid labsize(2)) ///
	tlabel(-25(5)25) tline(0, lcolor(black) lpattern("l")) ///
	ytitle("Count (Normalized to a 0-100 range)") xtitle("Day(s) from the election")   ///
	title("Macau Google Trend Data", size(4.0) position(11)) ///
	legend(on pos(6) row(1) label(1 "2015 Hong Kong local election") lab(2 "Weather")) 
graph export gtrend_2015hkdc+weather.png, replace	


*****************************************
* Uni Sieges and 2019 HKDC (Figure B.2) *
*****************************************
use "gtrend_CUHK+poly+weather.dta", replace 
set scheme white_ptol
gen x = date(date, "DMY")
gen day = x - td(24Nov2019)
tsset day

twoway tsline cuhk poly hkdc weather, yline(0, lw(vvthin)) lcolor("156 78 151" "255 87 51" "35 91 200"  black%40) lpattern("l" "l" "l" "shortdash") ylabel(0(20)100, nogrid labsize(2)) ///
	tlabel(-25(5)25) tline(0, lcolor(black) lpattern("l")) ///
	ytitle("Count (Normalized to a 0-100 range)") xtitle("Day(s) from the election")   ///
	title("Macau Google Trend Data", size(4.0) position(11)) ///
	legend(on pos(6) row(2) lab(1 "Chinese University of Hong Kong") lab(2 "Hong Kong Polytechnic University") lab(3 "2019 Hong Kong local election") lab(4 "Weather"))
graph export gtrend_cuhk+poly+weather.png, replace	